import * as Router from "koa-router";

const route: Router = new Router({prefix: "/api/user"})

import UserController from "../../routerController/user.controller"
import Validator from "../../middleware/validator"
// import UserController from "../../routerController/user.controller";
import { JwtAuth } from "../../middleware/jwt.auth"
//注册用户
route.post("/register",Validator.userLoginRegisterSchema, UserController.userRegister)

//用户登录
route.post("/login", Validator.userLoginRegisterSchema, UserController.userLogin)




//加入中间件
route.use(JwtAuth)
//更新用户信息
route.post("/updateUserInfo",UserController.updateUserInfo)


export { route }